pp108 : getSelectedItem Method

getSelectedItem Method


This method returns the currently selected item in the tree.

Syntax


otreeItem = treeID.getSelectedItem()

Return Value


Returns the item that is currently selected in the tree. If multiple items are selected, then this returns the last item that is selected. If nothing is selected, it returns NULL.

Example


The following example shows how the above method is used.

//Function call
var item = sampleTree.getSelectedItem();
//If item is not found alert error, else display the data contained in it
if (item)
{ 
    application.notify("item :\n\n" + cordys.getXML(item.data));
}
else
{
    application.notify("Error ! No item is selected !");
}

See Also


tree